
import java.util.Scanner;
import java.util.Arrays;
public class Text112 {
    public static void main(String[] args) {
        int[] arr={2,6,4,1};
        int[] arr2={1,2,34,3,4,5,7,23,12};
        isOdd(arr);
        isOdd(arr2);
    }

    private static void isOdd(int[] arr) {
        int count=0;
        for (int i = 0; i < arr.length-2; i++) {
            if(arr[i]%2!=0&&arr[i+1]%2!=0&&arr[i+2]%2!=0){
                count++;
            }
        }
        if(count>=1){
            System.out.println(true);
        }else{
            System.out.println(false);
        }
    }

    public static int mooreVote(int[] arr){
        int count = 0;
        int temp = arr[0];
        for (int i = 0; i < arr.length; i++) {
            if (count ==0 ){
                temp = arr[i];
            }
            if (temp == arr[i]){
                count++;
            } else {
                count--;
            }

        }
        return temp;
    }
    public static void main6(String[] args) {
        int[] arr={2,2,1,1,1,2,2};
        System.out.println("多数元素为:"+mooreVote(arr));
    }
    public static void main5(String[] args) {
        int[] array = {4,1,2,1,2};
        System.out.println(func(array));
    }
    public static int func (int[] array){
        int num=0;
        for(int i=0;i<array.length;i++){
            num^=array[i];
        }
        return num;
    }


    public static void select(int[] arr) {
        int i = 0;
        int j = arr.length - 1;
        while (i < j) {
            while (i < j && arr[i] % 2 != 0) {
                i++;
            }
            while (i < j && arr[j] % 2 == 0) {
                j--;
            }
            int tmp = arr[i];
            arr[i] = arr[j];
            arr[j] = tmp;
        }
    }
    public static void main4(String[] args) {
        int[] arr = {1, 2, 3, 4, 5, 6};
        select(arr);
        System.out.println(Arrays.toString(arr));
    }
    public static int sum(int[] array) {
        int sum = 0;
        for (int i = 0; i < array.length; i++) {
            sum += array[i];
        }
        return sum;
    }
    public static void main3(String[] args) {
        Scanner scan = new Scanner(System.in);
        int[] array = new int[5];
        for (int i = 0; i < 5; i++) {
            array[i] = scan.nextInt();
        }
        System.out.println(sum(array));
    }



    public static int[] transform(int[] array) {
        int[] ret = array;
        for (int i = 0; i < ret.length; i++) {
            ret[i] = ret[i]*2;
        }
        return ret;
    }
    public static void main2(String[] args) {
        int[] array ={1,2,3};
        System.out.println(Arrays.toString(transform(array)));
    }


    public static void main1(String[] args) {
        int[] arr=new int[100];
        assignment(arr);
        printArr(arr);
    }

    private static void printArr(int[] arr) {
        for (int i = 0; i < arr.length; i++) {

                System.out.print(arr[i] + ", ");

        }
    }

    private static void assignment(int[] arr) {
        for (int i = 0; i < arr.length; i++) {
            arr[i]=i+1;
        }
    }

}
